package com.quanshu.exchange.ui.widget;

import android.os.CountDownTimer;

/**
 * Created by jye on 2018/3/14.
 */

public class CountDownTimeProgressBar extends CountDownTimer {

    private RoundProgressBar roundProgressBar;
    private long millisInFuture;
    private long countDownInterval;

    public CountDownTimeProgressBar(RoundProgressBar roundProgressBar, long millisInFuture, long countDownInterval) {
        super(millisInFuture, countDownInterval);
        this.roundProgressBar = roundProgressBar;
        this.millisInFuture = millisInFuture;
        this.countDownInterval = countDownInterval;
    }

    @Override
    public void onTick(long l) {
        long time = millisInFuture - l + countDownInterval;
        roundProgressBar.setProgress((int) time);
    }

    @Override
    public void onFinish() {

    }
}
